
#include <FormatOutput.h>
#include <Unit.h>

using namespace std;

FormatOutput::FormatOutput()
{
}

const FormatOutput* FormatOutput::getFormatOutput()
{
    static const FormatOutput formatOutput;
    return &formatOutput;
}

void FormatOutput::output(int amount, std::ostream& stream, int factor, const char* name)
{
    if (amount/factor != 0)
    {
        stream << amount/factor << " " << name;
        if (amount%factor != 0)
        {
            stream << " ";
        }
    }
}
